<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>管理印章</title>
    <link rel="stylesheet" href="/asset/layui/css/layui.css">
    <link rel="stylesheet" href="/asset/css/index.css">
    <link rel="Shortcut Icon" href="cachet.ico">
    <script src="/asset/js/jquery.min.js"></script>
	<script src="/asset/layui/layui.js"></script>
</head>
<body >
<div class="alert_bigbox">
    <ul class="new_computer alert_box">
        <li>
            <div class="layui-input-inline ">
                <label class="layui-form-label">设备编号:</label>
                <div class="layui-input-inline new_textcontent">
                    ${devices.devicesId}
                </div>
            </div>
            <div class="layui-input-inline ">
                <label class="layui-form-label">印章名称:</label>
                <div class="layui-input-inline  new_textcontent">
                    ${devices.alias}
                </div>
            </div>
            <div class="layui-input-inline ">
                <label class="layui-form-label">状态:</label>
                <div class="layui-input-inline  new_textcontent">
                     ${devices.devicesStatus}
                </div>
            </div>
        </li>
        <li>
            <div class="layui-input-inline ">
                <label class="layui-form-label">开通时间:</label>
                <div class="layui-input-inline new_textcontent">
                    ${devices.installTime!?datetime}
                </div>
            </div>
            <div class="layui-input-inline ">
                <label class="layui-form-label">失效时间:</label>
                <div class="layui-input-inline new_textcontent">
                    ${devices.expireDate!?datetime}
                </div>
            </div>
        </li>
        <li>
            <div class="layui-input-inline ">
                <label class="layui-form-label">使用总次数:</label>
                <div class="layui-input-inline  new_textcontent">
                    ${devices.useTimes}
                </div>
            </div>
            <div class="layui-input-inline ">
                <label class="layui-form-label">外带次数:</label>
                <div class="layui-input-inline new_textcontent">
                    ${devices.useTimes}
                </div>
            </div>
        </li>
    </ul>
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li <#if type == "apply">class="layui-this"</#if>><a href="/custos/detail.htm?type=apply&devicesId=${devices.devicesId}">申请记录</a></li>
            <li <#if type == "used">class="layui-this"</#if>><a href="/custos/detail.htm?type=used&devicesId=${devices.devicesId}">使用记录</a></li>
        </ul>
        <div class="layui-tab-content" >
        	<#if type == "apply">
	            <div class="layui-show">
	                <table class="layui-table mytable" lay-even="" lay-skin="nob">
	                    <thead>
		                    <tr>
		                        <th>申请时间</th>
		                        <th>申请类型</th>
		                        <th>申请人</th>
		                        <th>申请用途</th>
		                        <th>审核人</th>
		                        <th>审核状态</th>
		                        <th>审核时间</th>
		                    </tr>
	                    </thead>
	                    <tbody>
	                    <#if pm?? && pm.datas?exists && pm.datas?size &gt; 0>
	                    	<#list pm.datas as item>
			                    <tr>
			                        <td>${item.applyTime!?datetime}</td>
			                        <td>
			                        	<#if item.applyType == "TEST_APPLY">
			                        		测试申请
			                        	<#elseif item.applyType == "USED_APPLY">
			                        		使用申请
			                        	<#elseif item.applyType == "TAKE_APPLY">
			                        		外带申请
			                        	<#elseif item.applyType == "URGENT_APPLY">
			                        		紧急申请
			                        	<#else>
			                        		未知
			                        	</#if>
			                        </td>
			                        <td>${item.person.name}</td>
			                        <td>${item.cause}</td>
			                        <td>
				                        <#if item.verifys?exists && item.verifys?size &gt; 0>
				                        	<#list item.verifys as verify>
				                        		${verify.personName}
				                        		<#if verify_has_next>
				                        			,
				                        		</#if>
				                        	</#list>
				                        <#else>
				                        	--
				                        </#if>
			                        </td>
			                        <td>
		                        		<#if item.applyStatus == "PENDING">
		                        			审核中
		                        		<#elseif item.applyStatus == "PASSED">
		                        			通过
		                        		<#elseif item.applyStatus == "REJECT">
		                        			拒绝
		                        		<#else>
		                        			未知
		                        		</#if>
			                        </td>
			                        <td>
			                        	<#if item.verifys?exists && item.verifys?size &gt; 0>
				                        	<#list item.verifys as verify>
				                        		<#if !verify_has_next && verify.verifyTime??>
				                        			${verify.verifyTime!?datetime}
				                        		
				                        		</#if>
				                        	</#list>
				                        <#else>
				                        	--
				                        </#if>
			                        </td>
			                    </tr>
	                    	</#list>
		                <#else>
		                	<tr>
		                		<td colspan="7">暂无数据</td>
		                	</tr>
	                    </#if>
	                    </tbody>
	                </table>
	                <@p.page pm=pm></@p.page>
	            </div>
        	<#else>
	            <div class="">
	                <table class="layui-table mytable" lay-even="" lay-skin="nob">
	                    <thead>
		                    <tr>
		                        <th>使用时间</th>
		                        <th>使用人</th>
		                        <th>凭证记录</th>
		                        <th>ip</th>
		                    </tr>
	                    </thead>
	                    <tbody>
	                    	<#if pm?? && pm.datas?exists && pm.datas?size &gt; 0>
	                    		<#list pm.datas as item>
				                    <tr>
				                        <td>${item.usedTime!?datetime}</td>
				                        <td>${item.partyName}</td>
				                        <td><a href="javascript:;">查看</a></td>
				                        <td>${item.usedIp}</td>
				                    </tr>
	                    		</#list>
	                    	<#else>
	                    		<tr>
			                		<td colspan="4">暂无数据</td>
			                	</tr>
	                    	</#if>
	                    </tbody>
	                </table>
	                <@p.page pm=pm></@p.page>
	            </div>
        	</#if>
        </div>
    </div>
</div>

<div id="showImg" style="position: fixed;top: 30%;left: 50%;z-index: 9999;">
	<img alt="" src="">
</div>
<script>
    function showImg(url){
    	$("#showImg").find('img').attr("src", url);
    }
</script>
</body>
</html>